Telegram Group & Telegram Channel
Pyshark — библиотека для анализа сетевого трафика на Python. Она позволяет работать с .pcap-файлами и захватывать трафик в реальном времени. Для работы нужно установить tshark (идёт вместе с Wireshark) и добавить его в PATH.

Пример анализа файла:
import pyshark

cap = pyshark.FileCapture('example.pcap')
for packet in cap:
print(packet)

Пример захвата в реальном времени:

live_cap = pyshark.LiveCapture(interface='eth0')
for packet in live_cap.sniff_continuously(packet_count=10):
print(packet)

Чтобы фильтровать данные, можно использовать дисплейные фильтры Wireshark:

cap = pyshark.FileCapture('example.pcap', display_filter='http')
for packet in cap:
print(packet.http.host)


Ставится командой ⚙️ pip install pyshark
Документация и примеры кода здесь.



tg-me.com/pythonturboru/603
Create:
Last Update:

Pyshark — библиотека для анализа сетевого трафика на Python. Она позволяет работать с .pcap-файлами и захватывать трафик в реальном времени. Для работы нужно установить tshark (идёт вместе с Wireshark) и добавить его в PATH.

Пример анализа файла:

import pyshark

cap = pyshark.FileCapture('example.pcap')
for packet in cap:
print(packet)

Пример захвата в реальном времени:

live_cap = pyshark.LiveCapture(interface='eth0')
for packet in live_cap.sniff_continuously(packet_count=10):
print(packet)

Чтобы фильтровать данные, можно использовать дисплейные фильтры Wireshark:

cap = pyshark.FileCapture('example.pcap', display_filter='http')
for packet in cap:
print(packet.http.host)


Ставится командой ⚙️ pip install pyshark
Документация и примеры кода здесь.

BY Python Turbo. Уютное сообщество Python разработчиков.




Share with your friend now:
tg-me.com/pythonturboru/603

View MORE
Open in Telegram


Python Turbo Уютное сообщество Python разработчиков Telegram | DID YOU KNOW?

Date: |

For some time, Mr. Durov and a few dozen staffers had no fixed headquarters, but rather traveled the world, setting up shop in one city after another, he told the Journal in 2016. The company now has its operational base in Dubai, though it says it doesn’t keep servers there.Mr. Durov maintains a yearslong friendship from his VK days with actor and tech investor Jared Leto, with whom he shares an ascetic lifestyle that eschews meat and alcohol.

Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.

Python Turbo Уютное сообщество Python разработчиков from us


Telegram Python Turbo. Уютное сообщество Python разработчиков.
FROM USA